{extend name="mainadmin@layouts/base" /}
{block name="main" }
<style>
    .h3{
        font-size: 18px;
    }
</style>
<script type="text/javascript" src="__STATIC__/js/highcharts/highcharts.js"></script>
<script type="text/javascript" src="__STATIC__/js/highcharts/highcharts_more.js"></script>
<section class="scrollable wrapper  ">
    <section class="panel panel-default ">
        {if condition="$isClearSetTip == true"}
        <header class="panel-heading font-bold red">
            检测到网站发现变化，是否要清理相关配置，<a href="{:url('mainadmin/backup_db/clear')}" class="btn btn-sm" >前往清理</a>
        </header>
        {/if}
        <div class="row m-l-none m-r-none bg-light lter">

            <div class="col-sm-6 col-md-3 padder-v b-r b-light ">

                <span class="fa-stack fa-2x pull-left m-r-sm  m-l">
                            <i class="fa fa-circle fa-stack-2x text-danger"></i>
                            <i class="fa fa-clipboard  fa-stack-1x text-white"></i>
                            <span class="easypiechart pos-abt" data-percent="100" data-line-width="4"
                                  data-track-color="#f5f5f5" data-scale-color="false" data-size="50"
                                  data-line-cap="butt" data-animate="3000" data-target="#firers"
                                  data-update="5000"></span>
                        </span>
                <a class="fl" href="{:url('shop/sys_admin.order/index',['reportrange'=>$today.'-'.$today])}">
                    <span class="h3 block m-t-xs"><strong id="t_day_order_num">{$stats.today.all_add_num}</strong></span>
                    <small class="text-muted text-uc">今天下单数</small>
                </a>
                <a class="fr" href="{:url('shop/sys_admin.order/index',['reportrange'=>$yesterday.'-'.$yesterday])}">
                    <span class="h3 block m-t-xs"><strong id="y_day_order_num">{$stats.yesterday.all_add_num}</strong></span>
                    <small class="text-muted text-uc">昨天下单数</small>
                </a>
                <div class="clearfix"></div>
            </div>
            <div class="col-sm-6 col-md-3 padder-v b-r b-light lt">
                        <span class="fa-stack fa-2x pull-left m-r-sm  m-l">
                            <i class="fa fa-circle fa-stack-2x text-warning"></i>
                            <i class="fa fa-yen fa-stack-1x text-white"></i>
                            <span class="easypiechart pos-abt" data-percent="100" data-line-width="4"
                                  data-track-color="#fff" data-scale-color="false" data-size="50" data-line-cap="butt"
                                  data-animate="2000" data-target="#bugs" data-update="3000"></span>
                        </span>
                <a class="fl" >
                    <span class="h3 block m-t-xs"><strong id="t_day_clinch_money">{$stats.today.order_pay_amount|priceToW}</strong></span>
                    <small class="text-muted text-uc">今天成交金额</small>
                </a>
                <a class="fr">
                    <span class="h3 block m-t-xs"><strong id="y_day_clinch_money">{$stats.yesterday.order_pay_amount|priceToW}</strong></span>
                    <small class="text-muted text-uc" >昨天成交金额</small>
                </a>
                <div class="clearfix"></div>
            </div>
            <div class="col-sm-6 col-md-3 padder-v b-r b-light">
                       <span class="fa-stack fa-2x pull-left m-r-sm  m-l">
                            <i class="fa fa-circle fa-stack-2x text-info"></i>
                            <i class="fa fa-truck fa-stack-1x text-white"></i>
                        </span>
                <a class="fl"  href="{:url('shop/sys_admin.order/index',['state'=>3])}">
                    <span class="h3 block m-t-xs"><strong id="t_day_wait_shipping_num">{$stats.wait_shipping_num}</strong></span>
                    <small class="text-muted text-uc">待发货订单</small>
                </a>
                <a class="fr" href="{:url('shop/sys_admin.order/index',['time_type'=>'shipping_time','start_time'=>$yesterday,'end_time'=>$yesterday])}">
                    <span class="h3 block m-t-xs"><strong id="y_day_shipping_num">{$stats.yesterday.order_shipping_num}</strong></span>
                    <small class="text-muted text-uc">昨天发货订单</small>
                </a>
                <div class="clearfix"></div>
            </div>
            <div class="col-sm-6 col-md-3 padder-v b-r b-light lt">
                        <span class="fa-stack fa-2x pull-left m-r-sm  m-l">
                            <i class="fa fa-circle fa-stack-2x icon-muted"></i>
                            <i class="fa fa-legal fa-stack-1x text-white"></i>
                        </span>
                <a class="fl" href="{:url('shop/sys_admin.order/index',['time_type'=>'sign_time','start_time'=>$today,'end_time'=>$today])}">
                    <span class="h3 block m-t-xs"><strong id="t_day_sign_num">{$stats.today.sign_num}</strong></span>
                    <small class="text-muted text-uc">今天签收订单</small>
                </a>
                <a class="fr" href="{:url('shop/sys_admin.order/index',['time_type'=>'sign_time','start_time'=>$yesterday,'end_time'=>$yesterday])}">
                    <span class="h3 block m-t-xs"><strong id="y_day_sign_num">{$stats.yesterday.sign_num}</strong></span>
                    <small class="text-muted text-uc">昨天签收订单</small>
                </a>
                <div class="clearfix"></div>
            </div>
        </div>
    </section>
    <section class="panel panel-default ">
        <div class="row m-l-none m-r-none bg-light lter">
            <div class="col-sm-6 col-md-3 padder-v b-r b-light ">
                <span class="fa-stack fa-2x pull-left m-r-sm  m-l">
                            <i class="fa fa-circle fa-stack-2x icon-muted"></i>
                            <i class="fa fa-yen fa-stack-1x text-white"></i>
                        </span>
                <!--<a class="fl" href="{:url('member/sys_admin.recharge/index')}">
                    <span class="h3 block m-t-xs"><strong id="wait_pay">{$rchargeLogNum}</strong></span>
                    <small class="text-muted text-uc">充值待审核</small>
                </a>-->
                <a class="fl" href="{:url('member/sys_admin.withdraw/index')}">
                    <span class="h3 block m-t-xs"><strong id="wait_withdraw">{$withdrawLogNum}</strong></span>
                    <small class="text-muted text-uc">提现待审核</small>
                </a>
                <div class="clearfix"></div>
            </div>
            <div class="col-sm-6 col-md-3 padder-v b-r b-light lt">
                        <span class="fa-stack fa-2x pull-left m-r-sm  m-l">
                            <i class="fa fa-circle fa-stack-2x text-warning"></i>
                            <i class="fa fa-user fa-stack-1x text-white"></i>
                            <span class="easypiechart pos-abt" data-percent="100" data-line-width="4"
                                  data-track-color="#fff" data-scale-color="false" data-size="50" data-line-cap="butt"
                                  data-animate="2000" data-target="#bugs" data-update="3000"></span>
                        </span>
                <a class="fl" href="{:url('member/sys_admin.users/index',['time_type'=>'reg_time','start_time'=>$today,'end_time'=>$today])}">
                    <span class="h3 block m-t-xs"><strong id="t_day_new_user">{$userStats['today_reg']}</strong></span>
                    <small class="text-muted text-uc">今天新增会员</small>
                </a>
                <!--<a class="fr" href="#">
                    <span class="h3 block m-t-xs"><strong id="y_day_new_user">{$userStats['today_sign']}</strong></span>
                    <small class="text-muted text-uc">今天签到会员</small>
                </a>-->
                <div class="clearfix"></div>
            </div>
            <div class="col-sm-6 col-md-3 padder-v b-r b-light">
                       <span class="fa-stack fa-2x pull-left m-r-sm  m-l">
                            <i class="fa fa-circle fa-stack-2x text-info"></i>
                            <i class="fa fa-users fa-stack-1x text-white"></i>
                        </span>
                <a class="fl" href="{:url('member/sys_admin.users/index')}">
                    <span class="h3 block m-t-xs"><strong id="user_num">{$userStats['all_num']}</strong></span>
                    <small class="text-muted text-uc">会员总数</small>
                </a>
                <a class="fr" href="{:url('member/sys_admin.users/index',array('rode_id'=>'all_role'))}">
                    <span class="h3 block m-t-xs"><strong id="user_role_num">{$userStats['role_num']}</strong></span>
                    <small class="text-muted text-uc">身份会员总数</small>
                </a>
                <div class="clearfix"></div>
            </div>
            <div class="col-sm-6 col-md-3 padder-v b-r b-light lt">
                  <span class="fa-stack fa-2x pull-left m-r-sm  m-l">
                            <i class="fa fa-circle fa-stack-2x text-danger"></i>
                            <i class="fa fa-yen  fa-stack-1x text-white"></i>
                            <span class="easypiechart pos-abt" data-percent="100" data-line-width="4"
                                  data-track-color="#f5f5f5" data-scale-color="false" data-size="50"
                                  data-line-cap="butt" data-animate="3000" data-target="#firers"
                                  data-update="5000"></span>
                        </span>
                <a class="fl" href="#">
                    <span class="h3 block m-t-xs"><strong id="balance_total">{$account.balance_money|priceToW}</strong></span>
                    <small class="text-muted text-uc">余额总数</small>
                </a>
                <a class="fr" href="#">
                    <span class="h3 block m-t-xs"><strong id="bean_total">{$account.use_integral|priceToW}</strong></span>
                    <small class="text-muted text-uc">积分总数</small>
                </a>
                <div class="clearfix"></div>
            </div>
        </div>
    </section>
    <div class="col-md-8">
        <section class="panel panel-default ">
            <header class="panel-heading font-bold">
                7天订单数据
                <small>（{$start_day}至{$end_day}）</small>

            </header>
            <div class="panel-body">
                <!--   style="height: 210px"  -->
                <div id="container"></div>
            </div>
            <footer class="panel-footer bg-white no-padder">
                <div class="row text-center no-gutter">

                    <div class="col-xs-3 b-r b-light">
                        <span class="h4 font-bold m-t block">{$stats.seven_add_num|intval}</span>
                        <small class="text-muted m-b block">下单总数</small>
                    </div>
                    <div class="col-xs-3 b-r b-light">
                        <span class="h4 font-bold m-t block">{$stats.seven_pay_num|intval}</span>
                        <small class="text-muted m-b block">成交总数</small>
                    </div>
                    <div class="col-xs-3 b-r b-light">
                        <span class="h4 font-bold m-t block">{$stats.seven_shpping_num|intval}</span>
                        <small class="text-muted m-b block">发货总数</small>
                    </div>
                    <div class="col-xs-3">
                        <span class="h4 font-bold m-t block">{$stats.seven_sign_num|intval}</span>
                        <small class="text-muted m-b block">签收总数</small>
                    </div>
                </div>
            </footer>
        </section>
    </div>
    <div class="col-md-4">
        <section class="panel panel-default">
            <header class="panel-heading font-bold">
                7天交易数据
                <small>（{$start_day}至{$end_day}）</small>

            </header>
            <div class="bg-light dk wrapper">
                <!--  style="height: 150px" -->
                <div class="text-center m-b-n m-t-sm">
                    <div id="total_money"></div>
                </div>
            </div>

            <div class="panel-body">

                <div class="row m-t-sm">
                    <div class="col-xs-3 m-l fl">
                        <small class="text-muted block">成交</small>
                        <span class="money">{$stats.seven_order_amount_all}</span>
                    </div>
                    <div class="col-xs-3 m-l fl">
                        <small class="text-muted block">实收</small>
                        <span class="money">{$stats.seven_real_amount_all}</span>
                    </div>
                    <div class="col-xs-3 m-l fl">
                        <small class="text-muted block">佣金</small>
                        <span class="money">{$stats.seven_dividend_amount_all}</span>
                    </div>
                </div>
            </div>
        </section>
    </div>

</section>
<script type="text/javascript">
    $(function () {
        $('#container').highcharts({
            chart: {type: 'spline'},
            title: {text: ''},
            subtitle: {text: ''},
            xAxis: { categories: {$riqi|raw}},
            yAxis: {
                title: {text: ''},
                min: 0
            },
            tooltip: {
                formatter: function () {
                    return '<b>时间:' + this.x + '</b><br>' + this.series.name + ': ' + this.y + '';
                }
            },
            series: [{
                name: '下单数 <span style="color:gray" >(点击隐藏)</span>',
                data: {$stats.all_add_num|json_encode|raw}
            },{
                name: '成交数 <span style="color:gray" >(点击隐藏)</span>',
                data: {$stats.order_pay_num|json_encode|raw}
            },{
                name: '发货数 <span style="color:gray" >(点击隐藏)</span>',
                data: {$stats.shipping_order_num|json_encode|raw}
            }, {
                name: '签收数 <span style="color:gray" >(点击隐藏)</span>',
                data:  {$stats.sign_order_num|json_encode|raw}
            }]
        });


        $('#total_money').highcharts({
            chart: {type: 'spline'},
            title: {text: ''},
            subtitle: {text: ''},
            xAxis: { categories: {$riqi|raw}},
            yAxis: {
                title: {text: ''},
                min: 0
            },
            tooltip: {
                formatter: function () {
                    return '<b>时间:' + this.x + '</b><br>' + this.series.name + ': ' + this.y + '';
                }
            },
            series: [{
                name: '成交',
                data: {$stats.seven_order_amount|json_encode|raw}
            },{
                name: '实收',
                data: {$stats.seven_real_amount|json_encode|raw}
            },{
                name: '佣金',
                data: {$stats.seven_dividend_amount|json_encode|raw}
            }
            ]
        });

            jq_ajax('{:url("distribution/sys_admin.setting/autoEval")}');
            jq_ajax('{:url("shop/sys_admin.order/autoSign")}');
        });
    </script>
</section>

{/block}
